<template>
	<view :class="personClass">
		<!-- #ifdef APP-PLUS -->
		<view class="statusBar"></view>
		<!-- #endif -->
		<!-- #ifdef MP-WEIXIN -->
		<view :class="device=='ios'?'ios_pageTitle':'and_pageTitle'">
			<view class="statusBar"></view>
			<view :class="['pageTitle','dFlex','jBetween_aCenter']">
				<view class="backIcon imgPublic"></view>
				<view class="title"></view>
				<view class="backIcon imgPublic"></view>
			</view>
		</view>
		<!-- #endif -->
		<view class='userCenter'>
			<view class='userInfo dFlex jStart_aCenter'>
				<view class='userTx imgPublic' @tap='goPage(29)' v-if='isLogin'>
					<image :src="datas.image_head" v-if="identity == '1'"></image>
					<image :src="datas.store_img" v-if="identity == '2'"></image>
				</view>
				<view class='userTx imgPublic'  v-else>
					<image src="https://wx.gdxixiashi.com/public/logo.png"></image>
				</view>
				<view class="otherInfo" v-if='isLogin'>
					<view class="identify dFlex jBetween_aCenter">
						<view class="contentLeft dFlex jStart_aCenter">
							<text v-if="identity == '1'">{{datas.nickName}}</text>
							<text v-if="identity == '2'">{{datas.store_name}}</text>
						</view>
						<view class="setIcon imgPublic" @tap='goPage(2)'>
							<image src="https://wx.gdxixiashi.com/public/images/person/set.png" mode="widthFix"></image>
						</view>
						<!-- <view class="exchange dFlex jEnd_aCenter" @tap.stop='changeIdentify()' v-if="datas.storeId > 0 && datas.storeId">
							<view class='changeIcon imgPublic'>
								<image src="https://wx.gdxixiashi.com/public/images/person/qiehuan@2x.png" mode="widthFix"></image>
							</view>
							<text>{{identity == '1'?'切换服务端':'切换用户端'}}</text>
						</view>
						<view class="exchange" v-else @tap='goPage(3)'>申请成为匣士</view> -->
					</view>
					<view class="idName">{{datas.grade_name}}</view>
					<view class='phone' >
						<text style="display: inline-block;margin-right:8px" v-if='datas.tel'>{{datas.tel}}</text>
						<text style="display: inline-block;" v-if='identity == "1" && datas.memberId'>邀请码：{{datas.memberId}}</text>
					</view>
					<view class='phone' v-if='identity == "2"'>
						<text style="display: inline-block;margin-right:8px">匣士编号：{{datas.storeId}}</text>
					</view>
				</view>
				<view @click='login' class="otherInfo" v-else>
					<view class="identify dFlex jBetween_aCenter">
						<view class="contentLeft dFlex jStart_aCenter">
							<text>登录/注册</text>
						</view>
					</view>
				</view>
				</view>
			<view class="tools dFlex jAround_aCenter" style="width:100%;" v-if='identity == 1'>
				<view class="toolOne" @tap='goPage(14)'> 
					<view class="toolNum">{{datas.coupon_count?datas.coupon_count:'0'}}</view>
					<text>优惠券</text>
				</view>
				<view class="toolOne" @tap='goPage(23)'>
					<view class="toolNum">{{datas.gold?datas.gold:'0'}}</view>
					<text>洗护券</text>
				</view>
				<view class="toolOne" @tap='goPage(5)'>
					<view class="toolNum">{{datas.card_count?datas.card_count:'0'}}</view>
					<text>洗护卡</text>
				</view>
				<view class="toolOne" @tap='goPage(30)'>
					<view class="toolNum">{{datas.bean?datas.bean:'0'}}</view>
					<text>洗护豆</text>
				</view>
			</view>
			<view class="tools dFlex jAround_aCenter" v-if='identity == 2'>
				<view class="toolOne"> 
					<view class="toolNum">{{datas.order_count?datas.order_count:0}}</view>
					<text>累计订单（个）</text>
				</view>
				<view class="toolOne">
					<view class="toolNum">{{datas.total?datas.total:0}}</view>
					<text>累计收入（元）</text>
				</view>
			</view>
			<view class='vip dFlex jBetween_aCenter' v-if='isLogin && identity == 1 && datas.is_show!="2"'>
				<view class="vipContent">
					<view class="vipLine dFlex jStart_aCenter">
						<view class="vipIcon imgPublic">
							<image src="https://wx.gdxixiashi.com/public/images/person/vip@2x.png" mode="widthFix"></image>
						</view>
						<text v-if="datas.gradeId > '1' && datas.gradeId!='3'">{{datas.grade_name}}</text>
						<text v-if="datas.gradeId == '1'">升级VIP</text>
						<text v-if="datas.gradeId == '3'">联系客服升级分公司</text>
					</view>
					<!-- <view class="vipTime" v-if="datas.is_vip == '2'">有效期至{{datas.vip_stop_time}}</view> -->
					<view class="vipTime" v-if="datas.is_vip != '1'">终身有效</view>
				</view>
				<view class="btn" @tap='goPage(1)' v-if="datas.gradeId == '1' ">升级</view>
				<view class="btn" @tap='goPage(1)' v-if="datas.gradeId == '2'">开通云店</view>
				<!-- <view class="btn" @tap='goPage(1)' v-if="datas.is_vip == '2'">续费</view> -->
			</view>
		</view>
		<view class="config dFlex jBetween_aStart" v-if='identity == 1'> 
			<!-- <view class="config_one" @tap='goPage(6)'>
				<view class="configLine dFlex jBetween_aCenter">
					<view class="config_ct">
						<view class="tit1">洗护券</view>
						<view class="tit2">下单当钱花</view>
					</view>
					<view class="lineIcon imgPublic">
						<image src="https://wx.gdxixiashi.com/public/images/person/amount.png" mode="widthFix"></image>
					</view>
				</view>
				<view class="lineCount">
					<text>{{datas.gold?datas.gold:'0.00'}}</text>元
				</view>
				<view class="btns dFlex jAround_aCenter">
					<view class="smallBtn" @click.stop="goPage('17')">充值</view>
					<view class="smallBtn" v-if="datas.gold >= 100" @click.stop="goPage('18')">转赠</view>
				</view>
			</view> -->
			<view class="config_one" >
				<view class="configLine dFlex jBetween_aCenter">
					<view class="config_ct">
						<view class="tit1">洗护金</view>
						<view class="tit2">随时随地提现</view>
					</view>
					<view class="lineIcon imgPublic">
						<image src="https://wx.gdxixiashi.com/public/images/person/amount.png" mode="widthFix"></image>
						<!-- <image src="https://wx.gdxixiashi.com/public/images/person/wallet.png" mode="widthFix"></image> -->
					</view>
				</view>
				<view class="lineCount" @tap='goPage(4)'>
					<text>{{datas.wallet?datas.wallet:'0.00'}}</text>元
				</view>
				<view class="btns dFlex jAround_aCenter">
					<view class="smallBtn" @click.stop="goPage('19')">兑换</view>
					
					<!-- #ifdef APP-PLUS -->
					<view class="smallBtn" @click.stop='goPage(31)'>充值</view>
					<!-- #endif -->
					<view class="smallBtn" @click.stop="goPage('28')">转赠</view>
					<view class="smallBtn" @click.stop="goPage('20')">提现</view>
				</view>
			</view>
			<view class="config_one" @tap='goPage(6)'>
				<view class="configLine dFlex jBetween_aCenter">
					<view class="config_ct">
						<view class="tit1">积分钱包</view>
						<view class="tit2">收益当钱花</view>
					</view>
					<view class="lineIcon imgPublic">
						<image src="https://wx.gdxixiashi.com/public/images/person/wallet.png" mode="widthFix"></image>
					</view>
				</view>
				<view class="lineCount">
					<text>{{datas.point?datas.point:0}}</text>
				</view>
				<view class="btns dFlex jAround_aCenter">
					<view class="smallBtn" @click.stop="goPage('25')">赚积分</view>
					<view class="smallBtn" @click.stop="goPage('26')">兑好礼</view>
				</view>
			</view>
		</view>
		<view class="config dFlex jBetween_aStart" v-if='identity == 2'>
			<view class="config_one" @tap='goPage(12)'>
				<view class="configLine dFlex jBetween_aCenter">
					<view class="config_ct">
						<view class="tit1">业绩</view>
						<view class="tit2">收入一目了然</view>
					</view>
					<view class="lineIcon imgPublic">
						<image src="https://wx.gdxixiashi.com/public/images/person/amount.png" mode="widthFix"></image>
					</view>
				</view>
				<view class="lineCount">
					<text>{{datas.yeji?datas.yeji:'0.00'}}</text>元 
				</view>
			</view>
			<view class="config_one" @tap='goPage(16)'>
				<view class="configLine dFlex jBetween_aCenter">
					<view class="config_ct">
						<view class="tit1">钱包</view>
						<view class="tit2">随时随地提现</view>
					</view>
					<view class="lineIcon imgPublic">
						<image src="https://wx.gdxixiashi.com/public/images/person/wallet.png" mode="widthFix"></image>
					</view>
				</view>
				<view class="lineCount">
					<text>{{datas.wallet?datas.wallet:'0.00'}}</text>元
				</view>
				<view class="btns dFlex jAround_aCenter">
					<view class="smallBtn" @click.stop="goPage('21')">提现</view>
				</view>
			</view>
		</view>
		<view class="part"  v-if='identity == 1'>
			<view class="tits dFlex jBetween_aCenter">
				<view class="tit">我的订单</view>
				<text @tap='goPage(7,0)' v-if="identity == '1'">查看全部</text>
			</view>
			<view class="menus dFlex fWap jAround_aCenter">
				<view class="menuOne dFlex flexDirection jCenter_aCenter" @tap='goPage(7,1)'>
					<view class="menuIcon imgPublic">
						<image src="https://wx.gdxixiashi.com/public/images/person/daifukuan@2x.png" mode="widthFix"></image>
					</view>
					<text>待付款</text>
				</view>
				<view class="menuOne dFlex flexDirection jCenter_aCenter" @tap='goPage(7,2)' >
					<view class="menuIcon imgPublic">
						<image src="https://wx.gdxixiashi.com/public/images/person/paidanzhong@2x.png" mode="widthFix"></image>
					</view>
					<text>派单中</text>
					<view class="showCount" v-if='datas.order_count2 > 0'>{{datas.order_count2}}</view>
				</view>
				<view class="menuOne dFlex flexDirection jCenter_aCenter" @tap='goPage(7,3)'>
					<view class="menuIcon imgPublic">
						<image src="https://wx.gdxixiashi.com/public/images/person/daishangmen@2x.png" mode="widthFix"></image>
					</view>
					<text>待上门</text>
					<view class="showCount" v-if='datas.order_count3 > 0 && identity == "1"'>{{datas.order_count3}}</view>
					<view class="showCount" v-if='datas.order_count1 > 0 && identity == "2"'>{{datas.order_count1}}</view>
				</view>
				<view class="menuOne dFlex flexDirection jCenter_aCenter" @tap='goPage(7,4)'>
					<view class="menuIcon imgPublic">
						<image src="https://wx.gdxixiashi.com/public/images/person/jinxingzhong@2x.png" mode="widthFix"></image>
					</view>
					<text>进行中</text>
					<view class="showCount" v-if='datas.order_count4 > 0 && identity == "1"'>{{datas.order_count4}}</view>
					<view class="showCount" v-if='datas.order_count2 > 0 && identity == "1"'>{{datas.order_count2}}</view>
				</view>
				<view class="menuOne dFlex flexDirection jCenter_aCenter" @tap='goPage(7,5)' v-if='identity == 2'>
					<view class="menuIcon imgPublic">
						<image src="https://wx.gdxixiashi.com/public/images/person/yiwancheng@2x.png" mode="widthFix"></image>
					</view>
					<text>已完成</text>
					<view class="showCount" v-if='datas.notice_count > 0'>{{datas.notice_count}}</view>
				</view>
			</view>
		</view>
		<view class='part'>
			<view class="tits dFlex jBetween_aCenter">
				<view class="tit">综合服务</view>
			</view>
			<view class="menus dFlex fWap jAround_aCenter">
				<view class="menuOne dFlex flexDirection jCenter_aCenter" @tap='goPage(27)'  v-if='identity == 1'>
					<view class="menuIcon imgPublic">
						<image src="https://wx.gdxixiashi.com/public/images/person/tuan.png" mode="widthFix"></image>
					</view>
					<text>我的拼团</text>
				</view>
				<view class="menuOne dFlex flexDirection jCenter_aCenter" @tap='goPage(11)'  v-if='identity == 1'>
					<view class="menuIcon imgPublic">
						<image src="https://wx.gdxixiashi.com/public/images/person/tixian@2x.png" mode="widthFix"></image>
					</view>
					<text>余额提现</text>
				</view>
				<view class="menuOne dFlex flexDirection jCenter_aCenter" @tap='goPage(13)' v-if='identity == 1'>
					<view class="menuIcon imgPublic">
						<image src="https://wx.gdxixiashi.com/public/images/person/yaoqing@2x.png" mode="widthFix"></image>
					</view>
					<!-- <text v-if='datas.gradeId != "3"'>分享好友</text> -->
					<text>我的云店</text>
				</view>
				<view class="menuOne dFlex flexDirection jCenter_aCenter" @tap='goPage(10)' v-if='identity == 1 && datas.is_show!="2"'>
					<view class="menuIcon imgPublic">
						<image src="https://wx.gdxixiashi.com/public/images/person/tuandui@2x.png" mode="widthFix"></image>
					</view>
					<text>我的团队</text>
				</view>
				<view class="menuOne dFlex flexDirection jCenter_aCenter" @tap='goPage(8)' v-if='identity == 1'>
					<view class="menuIcon imgPublic">
						<image src="https://wx.gdxixiashi.com/public/images/person/sucai@2x.png" mode="widthFix"></image>
					</view>
					<text>素材中心</text>
				</view>
				<view class="menuOne dFlex flexDirection jCenter_aCenter" @tap='goPage(9)' v-if='identity == 1'>
					<view class="menuIcon imgPublic">
						<image src="https://wx.gdxixiashi.com/public/images/person/bangzhu@2x.png" mode="widthFix"></image>
					</view>
					<text>百问百答</text>
				</view>
				<view class="menuOne dFlex flexDirection jCenter_aCenter" @tap='goPage(22)' v-if='identity == 1'>
					<view class="menuIcon imgPublic">
						<image src="https://wx.gdxixiashi.com/public/images/person/duihuan@2x.png" mode="widthFix"></image>
					</view>
					<text>我的兑换</text>
				</view>
				<!-- #ifdef MP-WEIXIN -->
				<button open-type="contact" class="menuOne dFlex flexDirection jCenter_aCenter">
					<view class="menuIcon imgPublic">
						<image src="https://wx.gdxixiashi.com/public/images/person/kefu@2x.png" mode="widthFix"></image>
					</view>
					<text>联系客服</text>
				</button>
				<!-- #endif -->
				<!-- #ifdef APP-PLUS -->
				<view class="menuOne dFlex flexDirection jCenter_aCenter" @click='goService'>
					<view class="menuIcon imgPublic">
						<image src="https://wx.gdxixiashi.com/public/images/person/kefu@2x.png" mode="widthFix"></image>
					</view>
					<text>联系客服</text>
				</view>
				<!-- #endif -->
				<view class="menuOne dFlex flexDirection jCenter_aCenter" @tap='goPage(24)' v-if='identity == 1'>
					<view class="menuIcon imgPublic">
						<image src="https://wx.gdxixiashi.com/public/images/person/notic.png" mode="widthFix"></image>
					</view> 
					<text>系统通知</text>
					<view class="showCount" v-if='datas.notice_count > 0'>{{datas.notice_count}}</view>
				</view>
				<view class="menuOne dFlex flexDirection jCenter_aCenter" @tap='goPage(3)' v-if='identity == 1 && !datas.storeId && datas.is_show!="2"'>
					<view class="menuIcon imgPublic">
						<image src="https://wx.gdxixiashi.com/public/images/person/xihuxia@2x.png" mode="widthFix"></image>
					</view>
					<text>成为洗匣士</text>
				</view>
				<view class="menuOne dFlex flexDirection jCenter_aCenter" @tap.stop='changeIdentify()' v-if="datas.storeId > 0 && datas.storeId">
					<view class="menuIcon imgPublic">
						<image src="https://wx.gdxixiashi.com/public/images/person/shezhi@2x.png" mode="widthFix"></image>
					</view>
					<text>{{identity == '1'?'切换服务端':'切换用户端'}}</text>
				</view>
				<!-- <view class="menuOne dFlex flexDirection jCenter_aCenter" @tap='goPage(15)'>
					<view class="menuIcon imgPublic">
						<image src="https://wx.gdxixiashi.com/public/images/person/shezhi@2x.png" mode="widthFix"></image>
					</view>
					<text>区域订单</text>
				</view> -->
				<view class="menuOne dFlex flexDirection jCenter_aCenter" v-if="identity == '1'"></view>
				<view class="menuOne dFlex flexDirection jCenter_aCenter" v-if="identity == '1'"></view>
				<view class="menuOne dFlex flexDirection jCenter_aCenter" v-if="identity == '1'"></view>
			</view>
		</view>
		<!-- 分公司完善信息 -->
		<view class="zz dFlex jCenter_aCenter" v-if='service_flag'>
			<view class="service">
				<view class="title">升级分公司</view>
				<view class="content">
					<!-- #ifdef MP-WEIXIN -->
					<picker mode="region" @change='changeArea'>
						<input type="text" v-model="area" disabled placeholder="请选择服务地区">
					</picker>
					<!-- #endif -->
					<!-- #ifdef APP -->
					<AddressPicker :level="3" @change='selAdd'>
						<input type="text" placeholder="请选择服务地区" v-model="area" disabled placeholder-style="color:#999999;">
					</AddressPicker>
					<!-- #endif -->
				</view>
				<view class="service_btns dFlex jAround_aCenter">
					<view class="btn" @click='close_serve'>取消</view>
					<view class="btn sure" @click='saveInfo'>保存信息</view>
				</view>
			</view>
		</view>
		
		<view class="seat"></view>
		<tabbar :actIdx='actIdx' ref='tabbar' :identity='identity' :qCount='qCount'></tabbar>
	</view>
</template>

<script>
	// #ifdef APP-PLUS
	import AddressPicker from "@/components/address-picker/AddressPicker.vue"
	// #endif
	export default {
		// #ifdef APP-PLUS
		components:{
			AddressPicker
		},
		// #endif
		data() {
			return {
				isLogin:true,
				device:getApp().globalData.platform,
				identity:uni.getStorageSync('identify')?uni.getStorageSync('identify'):'1',
				actIdx:4,
				datas:{},
				qCount:0,
				personClass:['person'],
				
				service_flag:false,
				chengshiArr:[],
				province_one:{},
				city_one:{},
				area_one:{},
				area:"",
				
				notic_noBindTel:false,
				serviceTel:"",
			};
		},
		onLoad(){
			this.$nextTick(()=>{
				// #ifdef APP-PLUS
				uni.hideTabBar();
				// #endif
				this.$refs.tabbar.init();
			})
			if(this.identity == '1'){
				this.actIdx = 4;
			}else{
				this.actIdx = 2;
			}
			// #ifdef MP-WEIXIN
			this.personClass = ['person',this.device == 'ios' ? 'iosPadding':'androidPadding'];
			// #endif
			this.getCity();
		},
		"$store.state.count": {
			//深度监听，可监听到对象、数组的变化
			handler(val,oldVal) {
				this.qCount = val;
			},
			deep: true, //true 深度监听
		},
		onShow(){
			this.isLogin = uni.getStorageSync('userId')?true:false;
			if(uni.getStorageSync('userId')){
				if(this.identity == '1'){
					this.tool.getUserInfo().then(res=>{
						this.datas = res;
						if(res.addshop==1){
							uni.navigateTo({
								url:'../person/storeapply'
							})
						}
						if(res.storeId > 0 && res.storeId){
							uni.setStorageSync('storeId',res.storeId);
						}
						if(!this.datas.tel && !this.notic_noBindTel){
							uni.showModal({
								title:'提示',
								content:'暂未绑定手机号码，是否现在绑定',
								success:(op)=>{
									if(op.confirm){
										uni.navigateTo({
											url:'/person/bindTel'
										})
									}
									this.notic_noBindTel = true;
								},
							})
						}
					}).catch(err=>{
						console.log(err);
					})
					
					this.initPlatformInfo();
				}else{
					this.tool.getStaffInfo().then(res=>{
						this.qCount = res.jiedan;
						this.datas = res;
					}).catch(err=>{
						console.log(err);
					})
				}
			}else{
				this.tool.getUserInfo().then(res=>{
					this.datas = res;
				}).catch(err=>{
					console.log(err);
				})
				// uni.redirectTo({
				// 	url:'/person/login'
				// })
			}
		},
		onShareAppMessage() {
			return{
				title:'洗匣士~您的家居窗帘清洗助手',
				path:'/pages/home?spreadId=' + (uni.getStorageSync('userId')?uni.getStorageSync('userId'):''),
				imageUrl:getApp().globalData.imgDomain+'public/logo.png',
				desc:'手机下单 | 专员取送 | 生态环保 | 轻奢洗护',
			}
		},
		onShareTimeline() {
			return{
				title:'洗匣士~您的家居窗帘清洗助手',
				path:'/pages/home?spreadId=' + (uni.getStorageSync('userId')?uni.getStorageSync('userId'):''),
				imageUrl:getApp().globalData.imgDomain+'public/logo.png',
				desc:'手机下单 | 专员取送 | 生态环保 | 轻奢洗护',
			}
		},
		methods:{
			initPlatformInfo(){
				this.tool.getData('User/about',{}).then(res=>{
					console.log('平台信息',res);
					if(res){
						this.serviceTel = res.tel;
					}
				}).catch(err=>{
					console.log(err);
				})
			},
			// 城市数据
			getCity(){
				this.tool.getData('User/getarea',{}).then(res=>{
					if(res){
						this.chengshiArr = res;
					}
				}).catch(err=>{
					console.log(err);
				})
			},
			// 保存省市区
			saveInfo(){
				if(!this.province_one || !this.city_one || !this.area_one){
					uni.showToast({
						title:'请设置分公司所在地区',
						icon:'none'
					})
					return;
				}
				this.tool.getData('User/addcompany',{
					memberId:uni.getStorageSync('userId'),
					province_id:this.province_one.area_id,
					city_id:this.city_one.area_id,
					area_id:this.area_one.area_id,
				}).then(res=>{
					if(res){
						this.close_serve();
						this.tool.getUserInfo().then(res=>{
							this.datas = res;
						}).catch(err=>{
							console.log(err);
						})
					}
				}).catch(err=>{
					console.log(err);
				})
			},
			close_serve(){
				this.service_flag = false;
				this.province_one = {};
				this.city_one = {};
				this.area_one = {};
				this.area = '';
			},
			// 选择省市区
			selAdd(e){
				// 省
				let idx_province = this.tool.getIdx(this.chengshiArr,'area_name',e.data[0].name);
				this.province_one = this.chengshiArr[idx_province];
				// 市
				let idx_city = this.tool.getIdx(this.province_one.list,"area_name",e.data[1].name);
				this.city_one = this.province_one.list[idx_city];
				// 区
				let idx_area = this.tool.getIdx(this.city_one.list,"area_name",e.data[2].name);
				this.area_one = this.city_one.list[idx_area];
				this.area = this.province_one.area_name+'-'+this.city_one.area_name+'-'+this.area_one.area_name;
			},
			//选择服务地区
			changeArea(e){
				// 省
				let idx_province = this.tool.getIdx(this.chengshiArr,'area_name',e.detail.value[0]);
				this.province_one = this.chengshiArr[idx_province];
				// 市
				let idx_city = this.tool.getIdx(this.province_one.list,"area_name",e.detail.value[1]);
				this.city_one = this.province_one.list[idx_city];
				// 区
				let idx_area = this.tool.getIdx(this.city_one.list,"area_name",e.detail.value[2]);
				this.area_one = this.city_one.list[idx_area];
				this.area = this.province_one.area_name+'-'+this.city_one.area_name+'-'+this.area_one.area_name;
			},
			// 切换身份
			changeIdentify(){
				if(this.identity == '1'){
					if(this.datas.store_ok == '11' || this.datas.store_ok == '3'){
						uni.showToast({
							title:this.datas.store_alert,
							icon:"none"
						})
						return;
					}
				}
				this.identity = this.identity == "1"?'2':'1';
				uni.setStorageSync('identify',this.identity);
				if(this.identity == '1'){
					this.actIdx = 3;
					this.tool.getUserInfo().then(res=>{
						this.datas = res;
					}).catch(err=>{
						console.log(err);
					})
				}else{
					this.actIdx = 2;
					this.tool.getStaffInfo().then(res=>{
						this.datas = res;
						console.log(res);
						uni.getLocation({
							type:'wgs84',
							success: (locate) => {
								this.tool.getData('User/changeInfo',{
									storeId:uni.getStorageSync('storeId'),
									lat:locate.latitude,
									lng:locate.longitude,
								}).then(res2=>{
									if(res2){}
								}).catch(err=>{
									console.log(err);
								})
							},
							fail:(err)=>{
								console.log(err);
							},
							complete:()=>{
								if(!res.area){
									uni.showModal({
										content:'当前未设置服务地区 无法接收订单消息。是否现在设置？',
										success: (op) => {
											if(op.confirm){
												uni.navigateTo({
													url:'../person/systemSet'
												})
											}
										},
										fail:(err)=>{
											console.log(err);
										}
									})
								}
							}
						})
					}).catch(err=>{
						console.log(err);
					})
				}
			},
			// 登录
			login(){
				// #ifdef MP-WEIXIN
				uni.navigateTo({
					url:'../person/login',
				})
				// #endif
				// #ifdef APP-PLUS
				uni.navigateTo({
					url:'../person/mobileLogin',
				})
				// #endif
			},
			// 在线客服
			goService(){
				uni.showModal({
					title:'申请权限',
					content:'本次申请使用您的电话权限用于拨打客服电话，是否同意',
					success:(op)=>{
						if(op.confirm){
							uni.makePhoneCall({
								phoneNumber:this.serviceTel,
							})
						}
					},
					fail:(err)=>{
						console.log(err);
					}
				})
				
				/* uni.navigateTo({
					url:'/person/online_service'
				}) */
			},
			// 页面跳转
			goPage(idx,status){
				if(!this.isLogin){
					uni.showModal({
						content:'登录后才能继续操作，是否现在去登录',
						success: (op) => {
							if(op.confirm){
								// #ifdef MP-WEIXIN
								uni.navigateTo({
									url:'/person/login'
								})
								// #endif
								// #ifdef APP-PLUS
								uni.navigateTo({
									url:'/person/mobileLogin'
								})
								// #endif
							}
						}
					})
					return;
				}
				if(idx == '1'){//会员
					if(this.datas.agent_alert == '1'){
						this.service_flag = true;
					}else{
						if(this.datas.gradeId==1){
							uni.navigateTo({
								url:'/shop/shopDetail?productId=20'
							})
						}
						if(this.datas.gradeId==2){
							uni.navigateTo({
								url:'/person/vip'
							})
						}
					}
				}else if(idx == '2'){//设置
					uni.navigateTo({
						url:'/person/systemSet'
					})
				}else if(idx == '3'){//成为洗匣士
					uni.navigateTo({
						url:'/person/apply'
					})
					// if(this.datas.is_ok == '2'){
					// 	uni.navigateTo({
					// 		url:'/person/apply'
					// 	})
					// }else{
					// 	uni.navigateTo({
					// 		url:'/person/unAuthen'
					// 	})
					// }
				}else if(idx == '4'){//洗护金
					uni.navigateTo({
						// url:'/person/wallet',
						url:'/person/xihuJin'
					})
				}else if(idx == '5'){//洗户卡
					uni.navigateTo({
						url:'/person/xihuCard'
					})
				}else if(idx == '6'){//积分
					uni.navigateTo({
						url:'/person/point'
					})
				}else if(idx == '7'){//订单
					uni.navigateTo({
						url:'/person/orders?status='+status
					})
				}else if(idx == '8'){//素材中心
					uni.navigateTo({
						url:'/person/material'
					})
				}else if(idx == '9'){//百问百答
					uni.navigateTo({
						url:'/person/queAns'
					})
				}else if(idx == '10'){//我的团队
					uni.navigateTo({
						url:'/person/team'
					})
				}else if(idx == '11'){//余额提现 
					uni.navigateTo({
						url:'/person/cash'
					})
				}else if(idx == '12'){//业绩
					uni.navigateTo({
						url:'/person/achieve'
					})
				}else if(idx == '13'){//邀请好友
					uni.navigateTo({
						url:'/home/invite'
					})
				}else if(idx == '14'){//优惠券
					uni.navigateTo({
						url:'/home/xihuQuan'
					})
				}else if(idx == '15'){//区域订单
					uni.navigateTo({
						url:'/person/areaOrder'
					})
				}else if(idx == '16'){//服务端钱包
					uni.navigateTo({
						url:'/person/store_wallet'
					})
				}else if(idx == '17'){//洗护券充值
					uni.navigateTo({
						url:'/person/recharge'
					})
				}else if(idx == '18'){//洗护券转赠
					uni.navigateTo({
						url:'/person/transfer'
					})
				}else if(idx == '19'){//洗护券兑换
					uni.navigateTo({
						url:'/person/exchange'
					})
				}else if(idx == '20'){//洗护金提现
					uni.navigateTo({
						url:'/person/cash'
					})
				}else if(idx == '21'){//服务端钱包提现
					uni.navigateTo({
						url:'/person/cash'
					})
				}else if(idx == '22'){//我的兑换订单
					uni.navigateTo({
						url:'/person/redeemOrders'
					})
				}else if(idx == '23'){//洗护券
					uni.navigateTo({
						url:'/person/wallet'
					})
				}else if(idx == '24'){//系统通知
					uni.navigateTo({
						url:'/person/notic'
					})
				}else if(idx == '25'){//赚积分
					uni.switchTab({
						url:'/pages/shop'
					})
				}else if(idx == '26'){//兑好礼
					uni.navigateTo({
						url:'/shop/pointShop'
					})
				}else if(idx == '27'){//拼团订单列表
					uni.navigateTo({
						url:'/person/orders_pt'
					})
				}else if(idx == '28'){//洗护金转赠
					uni.navigateTo({
						url:'/person/transfer2'
					})
				}else if(idx == '29'){//设置头像
					uni.navigateTo({
						url:'/person/head'
					})
				}else if(idx == '30'){//洗护豆
					uni.navigateTo({
						url:'/person/xihudou'
					})
				}else if(idx == '31'){//充值
					uni.navigateTo({
						url:'/person/recharge2'
					})
				}
			}
		}
	}
</script>

<style lang="scss">
	page{
		background: #f8f8f8;
	}
	.person{
		width: 100%;
		.service{
			width:90%;
			background:white;
			border-radius: 4px;
			overflow: hidden;
			.service_btns{
				width:100%;
				.btn{
					width:50%;
					padding:10px 0;
					text-align: center;
					font-size: 13px;
					color: #666666;
				}
				.sure{
					background: #1664FF;
					color:white;
				}
			}
			.content{
				width:100%;
				padding:12px;
				box-sizing: border-box;
				.info{
					width:100%;
					.info_title{
						width: 100%;
						margin-bottom: 8px;
					}
					.upImg{
						width: 120px;
						margin:0 auto;
					}
					.serviceOne{
						display: inline-block;
						width:calc((100% - 24px) / 3);
						margin-right: 12px;
						text-align: center;
						margin-bottom: 12px;
						padding:6px 0;
						border-radius: 50px;
						border:1px solid #909399;
						box-sizing: border-box;
						color:#666666;
						font-size:13px;
					}
					.active{
						background: #1664FF;
						color:white;
						border-color: #1664FF;
					}
					.serviceOne:nth-child(3n + 4){
						margin-right: 0;
					}
				}
			}
			.title{
				width:100%;
				padding:12px 0;
				text-align: center;
				border-bottom: 1px solid rgba(0,0,0,0.1);
			}
		}
		.tits{
			width:100%;
			font-size: 12px;
			color: #999999;
			margin-bottom: 10px;
			.tit{
				width: max-content;
				border-left: 3px solid #3073F7;
				font-size: 16px;
				color: #333333;
				padding:0 10px;
				font-weight: bold;
			}
		}
		.part{
			width: 100%;
			margin-bottom: 10px;
			background: white;
			padding: 14px 4%;
			box-sizing: border-box;
			.menus{
				width: 100%;
				background: white;
				padding: 10px 0 0;
				.menuOne{
					width: 25%;
					text-align: center;
					font-size: 12px;
					color: #666666;
					margin-bottom: 14px;
					position:relative;
					.showCount{
						width:16px;
						height:16px;
						text-align: center;
						line-height: 16px;
						background: red;
						color:white;
						border-radius: 50%;
						font-size:10px;
						position: absolute;
						top:-8px;
						right:16px;
					}
					.menuIcon{
						width: 40px;
						height: 40px;
						margin-bottom: 4px;
					}
				}
			}
		}
		.config{
			width: 100%;
			background: white;
			margin-bottom: 10px;
			.config_one{
				flex: 1;
				padding: 14px 18px 16px;
				box-sizing: border-box;
				.configLine{
					width: 100%;
					.config_ct{
						flex: 1;
						font-size: 10px;
						color: #999999;
						.tit1{
							color: #333333;
							font-size: 16px;
							margin-bottom: 3px;
						}
					}
					.lineIcon{
						width: 36px;
					}
				}
				.lineCount{
					margin: 10px 0 12px;
					width: 100%;
					text{
						color: #1664FF;
						font-size: 24px;
					}
				}
				.btns{
					width: 100%;
					font-size: 12px;
					color: #1664FF;
					.smallBtn{
						flex: 1;
						text-align: left;
					}
				}
			}
		}
		.userCenter{
			width: 100%;
			padding:12px 4% 0;
			box-sizing:border-box;
			background: linear-gradient(to right,#0d86fc,#0bcaf6);
			color: white;
			overflow: hidden;
			.vip{
				width: 90%;
				margin: 0 auto;
				background: linear-gradient(#f5eacf 0%, #e5cc95 100%);
				box-shadow: 0px 2px 4px 0px rgba(231,211,161,0.08), 0px -2px 4px 0px rgba(229,205,153,0.40) inset;
				border-radius: 12px 12px 0 0;
				padding: 14px 19px;
				box-sizing: border-box;
				color: #997848;
				.vipContent{
					flex: 1;
					font-size: 12px;
					.vipTime{
						margin-top: 6px;
					}
					.vipLine{
						font-size: 16px;
						.vipIcon{
							width:16px;
							margin-right: 6px;
						}
					}
				}
				.btn{
					width: auto;
					padding: 7px 16px;
					border-radius: 50px;
					color: white;
					background: linear-gradient(269deg,#9a7440 0%, #c2914f 100%);
				}
			}
			.tools{
				width: 90%;
				margin: 22px auto;
				.toolOne{
					flex: 1;
					text-align: center;
					font-size: 14px;
					.toolNum{
						font-size: 18px;
						margin-bottom: 6px;
					}
				}
			}
			.userInfo{
				width: 100%;
				.otherInfo{
					flex: 1;
					.identify{
						font-size: 18px;
						margin-bottom: 5px;
						.idName{
							margin-left: 12px;
							font-size: 12px;
						}
						.setIcon{
							width: 25px;
							height: 25px;
						}
						.exchange{
							width: auto;
							font-size: 13px;
							margin-left: 12px;
							.changeIcon{
								width: 16px;
								margin-right: 6px;
							}
						}
					}
					.grade{
						font-size: 12px;
					}
					.phone{
						font-size: 12px;
						margin-top: 5px;
					}
				}
				.userTx{
					width: 60px;
					height: 60px;
					border-radius: 50%;
					margin-right: 10px;
					overflow: hidden;
					image{
						width: 100%;
						height: 100%;
					}
				}
			}
		}
	}
	// #0d86fc  #0bcaf6
	.ios_pageTitle,.and_pageTitle{
		background: linear-gradient(to right,#0d86fc,#0bcaf6);
	}
	// #ifdef APP-PLUS
	.statusBar{
		background: linear-gradient(to right,#0d86fc,#0bcaf6);
	}
	// #endif
</style>
